angular.module('baisonCheck', ['baisonDb', 'baisonService'])
        //获取全部支付方式
        .factory('checkGetList', ['dbSelect', '$q', function (dbSelect, $q) {
                //获取支付方式，外币种类和本位币
                var get_list = function () {
                    return $q.all({
                        'checkType': dbSelect('YsPos', 'select * from PosCheck'),
                        'standard_coin': dbSelect('YsPos', 'select * from PosForeignCheck where standard = 1'),
                        'currencyType': dbSelect('YsPos', 'select * from PosForeignCheck')
                    });
                };
                var get_name_by_code = function (code) {
                    return dbSelect('YsPos', 'select CheckName from PosCheck where CheckCode="' + code + '"');
                };
                return {
                    get_list: get_list,
                    get_name_by_code: get_name_by_code
                };
            }]);